<!--
 * @Author: Leo.wang wanglizhigs@163.com
 * @Date: 2024-10-13 16:33:11
 * @LastEditors: Leo.wang wanglizhigs@163.com
 * @LastEditTime: 2024-10-13 21:30:02
 * @FilePath: /aibox/src/modules/center/src/personal.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div class="page full">
    <Header></Header>

    <van-tabs v-model:active="activeName" class="tabs " >
      <van-tab  class="full" name="goods" title="闲置" >
        <scroll-view
          class="scroll"
          scroll-y="true"
          @refresherrefresh="refreshAction"
          @scrolltolower="toLowerAction"
          refresher-enabled="true"
        >
          <div class="grid column_2 p_xs ">
            <div
              class="grid-item p_xs"
              v-for="item in dataList"
              :key="item.id"
            >
              <Good
                @click="navigate(`/modules/good/src/check?id=${item.id}`)"
                v-bind="item"
              ></Good>
            </div>
          </div>
        </scroll-view>
      </van-tab>
      <van-tab  class="full" name="trends" title="动态">
        <div class="section pitch_default p_default">
          <div class="row">三个月前</div>
          <div class="row">
            <Dynamic></Dynamic>
          </div>
          <div class="row">
            <Dynamic></Dynamic>
          </div>
          <div class="row">
            <Dynamic></Dynamic>
          </div>
        </div>
      </van-tab>
    </van-tabs>
  
  </div>
</template>

<script>
import { defineComponent, ref } from 'vue';
import Header from '../components/header.vue';
import { Good, Dynamic, Footer } from '@/components';
import { navigate } from "@/service/navigate";
import { getUserGoodList } from '@/api/good.service';
import { usePageList } from '@/hooks/index';

export default defineComponent({
  name: 'Personal',
  components: {
    Header,
    Good,
    Dynamic,
    Footer,
  },
  setup() {
    const activeName = ref('goods');

    const {
      dataList,
      toLowerAction,
      refreshAction,
    } = usePageList(getUserGoodList, {
      type: 'review',
    });

    return { navigate, activeName,    dataList,
      toLowerAction,
      refreshAction, };
  },
});
</script>


<style lang="scss" scoped>
.tabs {
  height: calc(100% - 160px);
}

::v-deep(.tabs) {
  
  .van-tabs__content {
    width: 100%;
    height: calc(100% - 44px);
  }
}
</style>
